package com.adinnet.core.weiMsg;

import com.adinnet.common.utils.DateUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by 蒋小金 on 2018/4/4 0004.
 */
public class TestWX {
    public static void main(String[] args) {
        //新增用户成功 - 推送微信消息
        senMsg("xxxxxx","xxxxxx", DateUtil.getCurrentDatetime(),"测试商品",DateUtil.getCurrentDatetime(),"申通快递");
    }
    public static void senMsg(String openId,String formId,String keyword1,String keyword2,String keyword3,String keyword4){

        Map<String,TemplateData> param = new HashMap<>();
        param.put("keyword1",new TemplateData(keyword1,"#173177"));
        param.put("keyword2",new TemplateData(keyword2,"#173177"));
        param.put("keyword3",new TemplateData(keyword3,"#173177"));
        param.put("keyword4",new TemplateData(keyword4,"#173177"));


        JSON.toJSONString(param);
        JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(param));
        //调用发送微信消息给用户的接口
       //WX_TemplateMsgUtil.sendWechatMsgToUser(openId, formId,formId, "#000000", jsonObject);
    }
}
